<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>移交记录</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
<div>
<div id="pageInTab" class="pageInTab">
	<div tabid="tabA" lselected="true">
		<div class="searchArea">
			<!-- 搜索表单开始 -->
			<form id="searchBar">
				<div class="fieldset1 clearFix">
					<div class="FXBR">
					<div class="fieldBox">
							<div class="label">项目名称</div>
							<div class="field">
								<input type="text" id="prjNm" name="prjNm" class="ui-textbox" ligerui="width: 160" value="">
							</div>
						</div>
						<div class="fieldBox">
							<div class="label">合同号</div>
							<div class="field">
								<input type="text" id="contractNo" name="contractNo" class="ui-textbox" ligerui="width: 160" value="">
							</div>
						</div>
						<div class="fieldBox">
							<div class="label">操作人</div>
							<div class="field">
								<input type="text" id="crtUsrNm" name="crtUsrNm" class="ui-textbox" ligerui="width: 160" value="">
							</div>
						</div>
						<div class="fieldBox">
		                    <div class="label">交接时间</div>
		                    <div class="field">
		                        <input ligerui="width: 100" name="crtTmStart" id="crtTmStart" type="text" class="ui-datepicker" value="">
		                        -
		                        <input ligerui="width: 100" name="crtTmEnd" id="crtTmEnd" type="text" class="ui-datepicker" value="">
		                    </div>
	               	    </div>
	               	    <div class="fieldBox col_50">
		                    <div class="label" style="width: 60px;">所属公司</div>
		                    <div class="field">
		                        <input name="cstMgrOrgCd" id="cstMgrOrgCd" type="text" value="" placeholder="请选择" ltype="combobox">
		                    </div>
			           </div>
						<div class="fieldBox">
							<div class="label">原客户经理</div>
							<div class="field">
								<input type="text" id="oldCstMgrNm" name="oldCstMgrNm" class="ui-textbox" ligerui="width: 160" value="">
							</div>
						</div>
						<div class="fieldBox">
							<div class="label">新客户经理</div>
							<div class="field">
								<input type="text" id="cstMgrNm" name="cstMgrNm" class="ui-textbox" ligerui="width: 160" value="">
							</div>
						</div>
						
					</div>
					<div class="clearFix"></div>
					
					<!-- 表单按钮 -->
					<div class="btnsBox formBtns notRight">
						<span id="searchBtn" class="sq-button-round">查询</span>
						<span id="clearBtn"   class="sq-button-round">清空</span>
						<input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
		            </div>
		            
				</div>
			</form>
			<!-- 搜索表单结束 -->
		</div>
		<!-- 列表显示块 -->
		<div id="ligergrid1" class="sq-grid"></div>
	</div>
	
</div>
</div>
</div>
<script type="text/javascript">
$(function () {
	initOrgTree();//初始化组织架构
	$("#searchBar").ligerForm();//初始化表单
    initGrid();//初始化列表
    searchBtnEvent();//查询按钮事件
    clearBtnEvent();//清空按钮事件
});
//查询参数
function getSearchParams(){
	var form = new liger.get("searchBar");
	var data = form.getData();
	return data;
}
//初始化列表
function initGrid(){
	$("#ligergrid1").ligerGrid({
		url:'<%=path%>/project/prjtransferinfo/initList.do',
		method:'get',
		parms:getSearchParams(),
		columns:[
			{ display: '项目名称', name: 'prjNm', minWidth: 150},
			{ display: '合同号', name: 'contractNo', minWidth: 150,
				render:function (rowdata, rowindex, value){
					return "<span title="+rowdata.contractNo+">"+rowdata.contractNo+"</span>";
				}
			},
			{ display: '原客户经理', name: 'oldCstMgrNm', minWidth: 70},
			{ display: '原客户经理工号', name: 'oldCstMgrCd', minWidth: 50},
			{ display: '新客户经理', name: 'cstMgrNm', minWidth: 50},
			{ display: '新客户经理工号', name: 'cstMgrCd', minWidth: 50},
			{ display: '所属机构', name: 'buOrgCdNm', minWidth: 70},
			{ display: '原省公司', name: 'oldPrOrgCdNm', minWidth: 60},
			{ display: '原分公司', name: 'oldCyOrgCdNm', minWidth: 90},
			{ display: '新省公司', name: 'prOrgCdNm', minWidth: 60},
			{ display: '新分公司', name: 'cyOrgCdNm', minWidth: 90},
			{ display: '交接操作人', name: 'crtUsrNm', minWidth: 80},
			{ display: '操作时间', name: 'crtTm',render:renderDate, minWidth: 60},
		],
		pageSize:10,
		root:'rows',
		record:'total',
		hideLoadButton:false,
		width:'100%',
		height:'100%',
		heightDiff:-2,
		isScroll: true,
		checkbox:true,//列表是否有选择框
		rownumbers:true//列表是否有行号
	});
	grid = liger.get("ligergrid1");
	grid.setHeight(100);
	//grid.options.isSingleCheck = true;//列表是否为单选
}
//查询按钮事件
function searchBtnEvent(){
	$("#searchBtn").click(function(event) {
		var form = new liger.get("searchBar");
		var data = form.getData();
		for (name in data){
			grid.setParm(name,data[name]);
		};
		grid.reload();
	});
}
//清空按钮事件
function clearBtnEvent(){
	$("#clearBtn").click(function(event) {
		$("#resetBtn").click();  //重置 input-text
		var form = liger.get("searchBar");
		form.setData({  //重置select等特殊表单
			"prjNm":"",
			"contractNo":"",
			"crtUsrNm":"",
			"crtTmStart":"",
			"actPayTmB":"",
			"crtTmEnd":""
		});
		searchOrgTree3.clear();
	});
}
//格式化时间
function renderDate(rowdata, index, value){
	var dateStr = "";
	if(null != value){
		var date = new Date(value);
		dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
	}
	return dateStr;
}
var searchOrgTree3;
function initOrgTree(){
	searchOrgTree3 = $("#cstMgrOrgCd").ligerComboBox({
        selectBoxWidth: 240,
        selectBoxHeight: 150,
        treeLeafOnly: false, //限制只能选叶节点，父节点不能点击
        valueField: 'orgCd',
        textField: 'orgDispNm',
   	 tree: {
            ajaxType: 'get',
            idFieldName:'orgCd',
            textFieldName: 'orgDispNm',
            checkbox: false,
            parentIcon: "none",
            childIcon: "none",
            needCancel : false,
        }
    });
	 var _url = '<%=path%>/warrant/warrantfilemanage/searchBuOrgTree.do';
	 AjaxUtils.ajaxGet(_url, {}, function(msg){
		if(msg.success == 1){
				searchOrgTree3.treeManager.setData(msg.data);
				searchOrgTree3.clear();
			}else{
				//UIUtils.alertError(msg.info);
				$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			}
	 },false);

} 




	
</script>

</body>
</html>
